import { initLang } from 'ad-ui-utils'
import Cookies from 'cookies-js'
import domain from 'stores/domain'
import { Map, List } from 'immutable'
import cache, {
  LANG,
  BASICENUMS,
} from 'cache'

if (!Cookies.get(LANG)) {
  Cookies.set(LANG, initLang(), { domain: __COOKIE_DOMAIN__ })
}

export default Map({
  lang: domain.create('Map', { lang: Cookies.get(LANG) || initLang() }),
  basics: domain.create('Map', { data: cache.get(BASICENUMS), _loading_: false }),
})
